{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* summary: 第三章实验的代码\n",
    "* author: Mr. GAO\n",
    "* date：2022-9-16\n",
    "* 微信公众号：genbotter\n",
    "**********"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 加载数据"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 导入pandas包，并将excel文件中的表读入到datframe型的raw_datas中"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "raw_datas = pd.read_excel('./Data/students_score.xlsx', engine=\"openpyxl\", sheet_name=\"成绩详情\")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 拆分解释变量和响应变量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_raw的类型：<class 'pandas.core.frame.DataFrame'>\n",
      "y_raw的类型：<class 'pandas.core.series.Series'>\n"
     ]
    }
   ],
   "source": [
    "X_raw = raw_datas[['作业成绩', '平时成绩']] \n",
    "y_raw = raw_datas['期末是否及格']\n",
    "print(\"X_raw的类型：\"+str(type(X_raw))+\"\\n\"+\"y_raw的类型：\"+str(type(y_raw)))"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 查看原始数据"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 查看原始数据表格前5行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学号</th>\n",
       "      <th>作业成绩</th>\n",
       "      <th>平时成绩</th>\n",
       "      <th>期末是否及格</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.27</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>2.2</td>\n",
       "      <td>1.53</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1.4</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>2.4</td>\n",
       "      <td>1.80</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.47</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   学号  作业成绩  平时成绩  期末是否及格\n",
       "0   1   0.0  1.27       0\n",
       "1   2   2.2  1.53       0\n",
       "2   3   1.4  1.00       0\n",
       "3   4   2.4  1.80       0\n",
       "4   5   3.0  1.47       0"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "raw_datas.head()  "
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 导入绘制图表的matplotlib包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib\n",
    "import matplotlib.pyplot as plt\n",
    "matplotlib.rc(\"font\",family='STSong')  #设置为支持中文的字体\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 根据是否通过考试，将raw_datas拆分成两个dataframe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "passed = raw_datas[raw_datas['期末是否及格'] == 1]     # 考试通过的\n",
    "not_passed = raw_datas[raw_datas['期末是否及格'] == 0] # 考试没有通过的"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 图表显示，通过和未通过两种类别的学生"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAqwAAAHCCAYAAAAq1JuHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAABSjElEQVR4nO3de3yT5f3/8XfaQsuhDVBbWmmFCoJUVESBoZsCDuxU8IiiY4j6VSfqZB5gbCrivgqeTxwUFQGLCAiiiCJDUKeygeOLHAfIr0ApxZYCaQukp+T3R0xomqRN26S5k76ej0cfcB+SXrlJ0zfXfV2fy2S32+0CAAAADCoq1A0AAAAAakNgBQAAgKERWAEAAGBoBFYAAAAYGoEVAAAAhkZgBQAAgKERWAEAAGBoMaFuQLDYbDYdPHhQ8fHxMplMoW4OAAAAarDb7SopKdHpp5+uqCjf/agRG1gPHjyo9PT0UDcDAAAAdcjNzVVaWprP4xEbWOPj4yU5LkBCQkKIWwMAAICaiouLlZ6e7sptvkRsYHUOA0hISCCwAgAAGFhdwzeZdAUAAABDI7ACAADA0AisAAAAM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riiSdC9bIajB5WhKXoKJMmDcvUvdkbZZLcJl85Q+ykYZlMuAIAeAiHibsmk0np6enatGmTevfurfvuu0/nn3++Bg4cqPnz52vLli0ek6aWLl0qk8mkuXPnqmfPnho3bpwkx1CDCy+8UP3799eqVau8jnU1OnpYEbayeqVq5qg+SjG73/ZPMcdp5qg+Ib+dAwAwpvpM3A2FwsJCdezYUYMGDdIXX3whSYqJiXFNnFqwYIEeeeQRt8fs3LlTPXv2VHJyss455xzddtttiotz/H7MycnR4sWL9dhjj+nGG2/UjBkzdPLkySZ9TY1FDyvCWlavVA3JTGGlKwCA34w+cfebb77RoEGDZDKZ1KZNG23fvl2ZmZmSpO+//149evTQaaed5vaYefPm6cEHH9SkSZN00UUX6Z133lFMTIzefvtt5eTk6O2331bbtm1100036fnnn1e3bt3Uu3dvjRw5UqNGjTL8CmIEVoS96CgTpasAAH4z+sTdf/zjH3rhhRckSXfffbfuuusuvfXWW5KkyZMn64MPPnA7v7CwUCUlJercubPb/rfeekuzZ89W27ZtdfXVV7v2W61WXXvttbrtttvUr1+/IL+awCCwAgCAZsU5cfeQxep1HKtJjuFloZi4e/ToUbVq1Upt27aV5Kiteu+992rMmDFq2bKlHnnkEbVv397tMe+9956eeuopVVZWSpKOHz+url276uKLL9a8efM8Vrn66quvtGTJkrAJqxJjWAEAQDPjnLgryaPaTKgn7r711lt68MEH3fb17t1b+fn52rBhg04//XS3Y1VVVerfv7/atWvn2temTRt17Nix1u/Tpk2bgLW5KRBYAQBAs2PEibt79uxRQkKCunTp4tq3Y8cO3XrrrXr66ac1bdo0DR48WGPGjNG///1v2e12RUdH65JLLpHkCK+RiiEBAACgWTLSxN0TJ05o2bJlevjhhyU5Fg6YPn267Ha75s2b5xoi8MMPP+j222/Xr371KyUmJqpHjx764osv1LZtW1VVVclms7k9b3FxsduyrJJ07NgxZWVlNcnrChQCKwAAaLaMMHG3tLRUn376qcaNG6edO3fq22+/VUVFhR588EG3W/2SlJ6ertWrV2v+/PkqKSnR73//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T1OnTtXatWs1ffp0DRw4UAMHDtSECRNksVg0fvx4/fWvf1WfPn0C9fJrxRhWAADQ/FSfYNW+i/sY1uoTsZqqORaL/vznP+udd96ptYznueeeqw8++ECDBw9WZmamLrzwQtex7Oxs3X777a7twYMHa8WKFXr11Ve1YsUKLV261OP5rFarjh49qssuu0wbNmyQJP3888+uHl2bzaZXXnnF7TFjxoxRv379/J4IFgj0sAIAgObFkuceVseskM7o7z6mdc5VjvOaQH5+vh599FFNmzZNnTt3rvP83/zmNxo7dqzbvvLycu3YscNjpapRo0bpySefVHp6utdJW9u2bdODDz7otq9z586Kiam9T7NNmzZ1tjOQCKwAAKB5iW3rqLNac4JV9YlYbZIc5wXZnj179NFHH2natGk67bTT/H7cq6++6ta7+vbbb3sEzzlz5ujll19WTk6OzGazunfvrueff14HDx50nXPhhRe6wmdVVVUjX03wMCQAAAA0L3Fmx6IA3la6MqdJYz5rspWukpKSPHpLq6usrKzzOdatW6ezzjpLGRkZru25c+cqKytL8+bNkyS99NJLuvTSS3XPPfdo/PjxOuuss3TTTTfpf//3f13PU1VVJZvN5tq22Wz68MMPtWnTJrfv99///tfr5K1gIrACAIDmJ87sO5A2Yf3VhISEWo8fP3681uPbtm1TVVWVLr/8cq1atUq7du1SRkaGZs6c6bY0qyRde+21uuyyyzR16lTddNNNHhOwKioqVF5e7rZ94403eh3DarVa/Xh1gUNgBQAAMKDKykqlpqbWes5ZZ52lli1b6ujRo/rVr36loUOH1np++/bt9eyzz3o9FhUV5TbhKyoqSt26dfM4r127dk0+htVkr6sCbZgqLi6W2WyWxWKp838vAADA2KxWq3JycpSRkaG4uLhQNwd+8OffzN+8xqQrAAAAGBqBFQAAAIZGYAUAAIChEVgBAEDYiNCpNxEpkP9WBFYAAGB4LVq0kCSdOHEixC2Bv5z/Vs5/u8agrBUAADC86OhotWvXTgUFBZKk1q1be9QZhTHY7XadOHFCBQUFateunaKjoxv9nARWAAAQFlJSUiTJFVphbO3atXP9mzUWgRUAAIQFk8mk1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ABgaARWAAAAGBqBFQAAAIZGYAUAAIChEVgREuXl5ZoxY0aom9Hk7Ha7CgoK9MEHH4S6KWGnub5n0HjN8eeOn5fGaY7vGaMjsNZTbm6uZs2apQ8++EBz5szxes6iRYu0YMECvfvuu9q2bVvTNjCENmzYoGuvvVb9+vXTLbfcotLSUo9zhg0bpm7duikzM1Nz584NQStD46uvvtIZZ5yhs846SxdffLGqqqo8zvnss8/0/vvv67333tN3330XglY2rTlz5qhjx45KS0tzfZ133nke5zWn98zq1at19dVXu+3z5/PEn8+lcFbzuthsNk2YMEFDhgzR+eefr+XLl3t9nD8/d+HM2/vFn5+XY8eOaebMmVq4cKHefPNNVVRUNEVzm1TNa9OzZ0+3z5rExEQtWrTI43GR/p7x9Xs6LD5n7KiXu+66y26z2ex2u93+zTff2OfPn+92/KuvvrK/9957ru17773XXlVV1aRtDIWysjL7448/bq+srLTb7Xb7H//4R/v48eM9zqt+bZqTtWvX2nNzc30e3717t33q1Kmu7UceecReXFzcFE0LmbVr17reL3a73V5QUGB/4403PM5rLu+ZRYsW2Z977jn7ZZdd5trn7+dJXZ9L4czbdZk7d6598+bNdrvdbv/pp5/sSUlJ9sOHD3s8tq6fu3Dm7brY7f79vPzpT3+yHz9+3G632+379u2zP/PMM8FoYsh4uzarV692O2fq1Kn28vJyj8dG8nvG1+/pcPmcoYe1HrZs2aLy8nKZTCZJ0q9+9Su9/vrrbue89tpr+vWvf+3aTkpK0ueff96k7QyF/Px83X///YqOjpbk+F/+jh07Qtyq8DFz5kz179/ftZ2Zmal58+aFsEXBN3DgQNf7RZIWL16sESNGhLBFoZWVleXx+v35PPHncymcebsuPXv21LnnnitJ6tq1q7p06aJ9+/aFonkh4+26+OPw4cPasWOHWrduLUk644wztGzZsojqSfR2bS6//HLX3ysqKmQymdSiRYumblpI+fo9HS6fMwTWetiwYYNSUlJc2y1atND+/ftVWVnp85yUlBRt2LChSdsZCp07d1ZycrJre8uWLW4fEE6ffvqpTj/9dHXr1k0ffvhhUzYx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zubm5Wrx4sRITE2W1WnXPPfe4xri89tprkqS5c+cqKipKx44d08CBA12zWSPZ3Llz9de//lVJSUmSHEWXCwsLdeONN0pyXJs1a9Zo4sSJuu6669S+fXv17dtXffr0CWWzm8zNN98sSfrd736niooKjRkzRq+99pq++eYbffzxx5KkZcuW6dixYyovL1ePHj102WWXhbLJTebdd9/V8OHDlZiYKEluP0/N6T1TWFioGTNmaNasWXr33Xc1dOhQSd4/T/bt26cBAwZo3bp16ty5s9fPpUhR87pcdtll6tOnj9uQoyNHjujRRx/V8OHD3a6Lt5+7SJkZ7u394uvn5eTJkzr77LO1YMECXXzxxbJYLHrrrbfUsWNHHTlyRGPHjo2Y6yL5/lmSpOeff16PPvqoa7vmz1Ikv2d8/Z4+ePBgWHzOEFgBAABgaAwJAAAAgKERWAEAAGBoBFYAAAAYGoEVAAAAhkZgBQAAgKERWAEAAGBoBFYAAAAYGoEVAALIZrOFugkBQYluAEZCYAWABvr444+1bds217bValWfPn20e/fuej3Pa6+9ppMnT0qSZs6cqW+++abBbfrggw+Ul5cnq9Va57n/+c9/9MYbb3g9dv/992vhwoUNbgcABBKBFQAaaMqUKfrPf/7j2l6+fLl69uypbt261et5XnzxRR08eFCS9O9//1tFRUUNbtOSJUu0atUq5efn67bbbtP69et9njt58mQVFxdLkmuNcKfKykp17drVtf3aa6/pwIEDDW4XADRGTKgbAADhaN++fWrdurVGjx7t2pedna3p06fLZDK5nbthwwZ16dLFtYZ3TSkpKa5wGBsbq4yMjAa3q02bNrrooouUkZGh8ePH6/HHH9fSpUs9zlu9erU6deqk8ePHS5JeffVVLVmyRHFxcZKkXbt26YcfflB8fLzrMRUVFXr44Ycb3DYAaCgCKwA0wNtvv60///nPru0dO3bom2++0ahRozzO3bFjh3r27KmvvvrK63NVD7g1w67kCIotWrRwbZeXl+vll1/WhAkTPM6Nj49XZWWlJOmcc87R0qVLNWXKFF1zzTXKzMx0Pf799993DQcYN26crrvuOo0bN871ff74xz/qf/7nf3TRRRdp586dKi8v17nnnlvXZQGAoCCwAkA9VVRUaM2aNZo8ebJr30svvaQ1a9Zo586dOnTokMaNG+f1sRs3blRaWpqSk5P9+l5fffWVnnjiCX3++edq06aNJCkmJkbPPPOMPv/8c4/z9+3bp3/+859q166d2/7CwkK99NJLkhxh++mnn1bLli313Xff6R//+IceeeQRjR8/XuvXr1eLFi20a9cubdiwwdXD2rt3b73yyit+tRkAAo3ACgD1lJ2drZycHK1evVpDhw7V7t27lZCQoAsuuEA7d+6s9bEXXHCBJkyYoKlTpyoqqu5pBM8//7yuu+46tW7d2rUvKipK5557rtce22nTpun000/X9ddf7/X51q5dq8WLF+v48eM688wz9cQTT2jhwoXq2LGjXn75Zdd51XtYJccEs5ycnEYNVwCAhiKwAkA9VFZWatOmTRo4cKC6d+8uSXrrrbc0adIkr+d/+eWXSkpK0nnnnSfJccs/MzNT77zzju66665av9d//vMflZWVuQ098CYvL0+7d+/WwIEDlZaWpry8PNexoUOH6u9//7v69+8vSbr00kv1xhtvqEePHnriiSf08MMPq1evXrrllluUm5urmJhTvxYeeeQRt+/Tr18/Pffcc7W2BQCCgcAKAPXw/vvv6/7773cNB/juu+90ww03KCEhwXXOtGnTtGzZMkmOuqydO3fWe++95zp+4403KjMzU7fddptatmzp83tNmTJFM2bM8Hps69atGjhwoCTpxIkT2rdvn3766Sf16NFDa9eulSTt3r1bhYWF6tu3r+tx0dHR6tGjh7Zu3ari4mLdcccdkqQFCxZo+/bt6tmzp9dJYxdddJHX8bUA0BQIrADgpyNHjiguLk5nnXWWa9/pp5/ucZv8/vvv9zmGVZLatm2r9PR0ffLJJ7rxxhu9nvPVV1/poosucvXiVme329WnTx+tWbNGkrR582ZNnz5d8fHx6t69u3bt2iXJEa7Hjx/vMfSgvLxc2dnZeuGFF9z2P/nkk8rNzVVsbKzb/v/+97+6//779dhjj/l8TQAQTARWAPBTUVGRbrrpJrd9DR3TmZGRoZ9++snrMZvNpoULF+r111/3ery8vNwtVFqtVteErOjoaMXFxenYsWNatWqV/va3v7k9trKyUjfccIO6d++uhx56SJ06ddKZZ56pq6++WlFRUVq8eLHS0tK0f/9+paeny2QyacyYMbr55psb9DoBIBAIrADgp+o9q/Xx17/+VX/7299coVKSsrKyNGjQIK/nz5kzRw8//LDbeNLqLBaLOnTo4Nq2Wq1q27ata3vYsGG64YYbdPfdd3s8R0xMjG655RaZzWYNHjxYrVq18tnmq6++WiNHjpTkvdwWADQVAisABFj1MaxOH374oW677TbXtrd6rU59+/atdbWsvLw8nXHGGa7tkpIStzJWQ4YM0QMPPKDly5e79u3atcs1vODWW291e76DBw+qdevWstvtrn05OTkaPny4zzYAQFMisAJAA1QPdzXVNYa1LnUV6N+8ebP69u2rnTt3qmPHjtq0aZM6d+7satdjjz2miRMnauzYsXr33XdlMpn0xRdfqHv37iovL9f//d//6V//+pd2796tTp066ZJLLtFvfvMbVVVVSXLUbI2Li3OV0kpKSnKtgAUAoVB3EUAAgAebzeZ1vzP0eVNWVlbv7/Pzzz/r1ltvVXl5uWvfqlWrdMUVVyglJUUPPfSQli5dqquvvlqSNGHCBI0aNUqPPfaYysvLNWLECBUWFmrDhg2SHFUN7rrrLlfd1YkTJ+rSSy+VyWTS/PnzlZaWpgkTJuihhx7S559/rpdffll33HGH0tLS6t12AAgUelgBoAEqKip87q8eLqt75JFH9O9//9ttEQBJiouLc5WokuS1d3bp0qUaOXKkdu7cqT59+rjGw7755puKjo5WVVWVJk6cqGHDhuk3v/mNJGnevHm688471bVrV1dpq0GDBunHH3/0Oia1srJS48eP10UXXaSrrrpKknThhRfqvvvu08mTJ5Wdne2xghYANAUCKwA0QHx8vEfwlByTmqpPiKrO16x/f9lsNn322WduCwm0aNFCe/fu1aeffqo///nPbku+xsTEaO7cufrtb3+r5557Tvn5+UpNTfUIqz/99JNWr16toqIi3X///W6Ty5KTk7V48WL95S9/0SeffKLRo0c36jUAQEOY7LUNxAIAGIbNZpPNZvOY+V9WVuZRO7U+8vLy1KlTp8Y2DwCChsAKAAAAQ2PSFQAAAAyNwAoAAABDI7ACAADA0AisAAAAMDQCKwAAAAyNwAoAAABDI7ACAADA0AisAAAAMLT/D6kWcEdKgw0sAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 800x500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig=plt.figure(figsize=(8,5))\n",
    "ax=fig.add_subplot(1,1,1)\n",
    "plt.scatter(x=passed['作业成绩'],y=passed['平时成绩'],marker='o', label='及格')\n",
    "plt.scatter(x=not_passed['作业成绩'],y=not_passed['平时成绩'],marker='x', label='不及格')\n",
    "plt.legend(loc = 0, prop = {'size':12})\n",
    "ax.set_xlabel('作业成绩', fontsize = 12)\n",
    "ax.set_ylabel('平时表现', fontsize = 12)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 将数据拆分为训练集和测试集"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 导入train_test_split函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 训练集、测试集拆分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "40    1\n",
       "42    1\n",
       "2     0\n",
       "49    1\n",
       "51    1\n",
       "26    1\n",
       "34    1\n",
       "Name: 期末是否及格, dtype: int64"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train,X_test,y_train,y_test=train_test_split(X_raw,y_raw,test_size = 0.1,random_state = 1)\n",
    "y_test"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 使用sklearn包中逻辑回归模型进行训练"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 导入逻辑回归模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 训练逻辑回归模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LogisticRegression()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LogisticRegression</label><div class=\"sk-toggleable__content\"><pre>LogisticRegression()</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "LogisticRegression()"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_logi_reg_model = LogisticRegression()\n",
    "my_logi_reg_model.fit(X_train, y_train)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 用测试数据测试训练好的模型"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 使用训练好的模型预测训练集中X_test的结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_test_predict = my_logi_reg_model.predict(X_test)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 计算对测试集预测的准确率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "对测试集的正确预测率为：0.8571428571428571\n"
     ]
    }
   ],
   "source": [
    "from typing import Counter\n",
    "\n",
    "\n",
    "predict_correct = [1 if a==b else 0 for(a,b) in zip(y_test_predict, y_test)] # 逐个对比测试集的预测结果是否正确，正确记1、错误记0\n",
    "accuracy = Counter(predict_correct)[1] / len(y_test)\n",
    "print('对测试集的正确预测率为：' + str(accuracy))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.13 ('ai_textbook')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "b588930fc60eaaede1f012d63146846ff2d52ca36ecacf26d634dd660f785639"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
